home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- BackColor = &H00C0C0C0&
- Caption = "FTP DEMO"
- ClientHeight = 4350
- ClientLeft = 1200
- ClientTop = 1365
- ClientWidth = 6195
- Height = 4755
- Left = 1140
- LinkTopic = "Form1"
- ScaleHeight = 4350
- ScaleWidth = 6195
- Top = 1020
- Width = 6315
- Begin TextBox tRemotefile
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 285
- Left = 4080
- TabIndex = 5
- Top = 1440
- Width = 2055
- End
- Begin CommandButton Command5
- Caption = "Logoff"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Left = 4440
- TabIndex = 20
- Top = 120
- Width = 855
- End
- Begin CommandButton Command4
- Caption = "Logon"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Left = 3480
- TabIndex = 19
- Top = 120
- Width = 855
- End
- Begin CommandButton Command3
- Caption = "Change Directory"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Left = 120
- TabIndex = 18
- Top = 1800
- Width = 1695
- End
- Begin CommandButton Command2
- Caption = "Download File"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Left = 120
- TabIndex = 17
- Top = 2160
- Width = 1695
- End
- Begin CommandButton Command1
- Caption = "Upload File"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Left = 120
- TabIndex = 16
- Top = 2460
- Width = 1695
- End
- Begin Frame Frame1
- BackColor = &H00C0C0C0&
- Caption = "Tranfer Mode"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 1335
- Left = 120
- TabIndex = 12
- Top = 2880
- Width = 1695
- Begin OptionButton optTransferMode
- BackColor = &H00C0C0C0&
- Caption = "Binary"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 2
- Left = 240
- TabIndex = 15
- Top = 840
- Width = 855
- End
- Begin OptionButton optTransferMode
- BackColor = &H00C0C0C0&
- Caption = "ASCII"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 1
- Left = 240
- TabIndex = 14
- Top = 540
- Width = 855
- End
- Begin OptionButton optTransferMode
- BackColor = &H00C0C0C0&
- Caption = "Default"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 0
- Left = 240
- TabIndex = 13
- Top = 240
- Value = -1 'True
- Width = 855
- End
- End
- Begin TextBox tRemotePath
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 285
- Left = 1920
- TabIndex = 4
- Top = 1440
- Width = 2055
- End
- Begin TextBox tLocalFile
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 285
- Left = 120
- TabIndex = 3
- Text = "c:\testftp.1"
- Top = 1440
- Width = 1695
- End
- Begin FTP FTP1
- AltFile = ""
- Height = 420
- Left = 5520
- LocalFile = ""
- Password = ""
- RegHandle = FTP.FRX:0000
- RemoteFile = ""
- RemoteHost = ""
- RemotePath = ""
- Top = 120
- TransferMode = 0 'Default
- User = ""
- Width = 420
- WinsockLoaded = 0 'False
- End
- Begin ListBox lFiles
- BackColor = &H00FFFFFF&
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "Courier New"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 2550
- Left = 1920
- TabIndex = 9
- Top = 1800
- Width = 4215
- End
- Begin TextBox tFTPServer
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 285
- Left = 1080
- TabIndex = 0
- Top = 120
- Width = 2295
- End
- Begin TextBox tUser
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 285
- Left = 1080
- TabIndex = 1
- Top = 480
- Width = 1335
- End
- Begin TextBox tPassword
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 285
- Left = 3360
- PasswordChar = "*"
- TabIndex = 2
- Top = 480
- Width = 1335
- End
- Begin Label lPITrail
- BackStyle = 0 'Transparent
- BorderStyle = 1 'Fixed Single
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Left = 120
- TabIndex = 22
- Top = 840
- Width = 6015
- End
- Begin Label Label1
- BackStyle = 0 'Transparent
- Caption = "Remote File:"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 5
- Left = 4080
- TabIndex = 21
- Top = 1200
- Width = 1095
- End
- Begin Label Label1
- BackStyle = 0 'Transparent
- Caption = "Remote Path:"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 4
- Left = 1920
- TabIndex = 11
- Top = 1200
- Width = 1095
- End
- Begin Label Label1
- BackStyle = 0 'Transparent
- Caption = "Local File:"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 3
- Left = 120
- TabIndex = 10
- Top = 1200
- Width = 1095
- End
- Begin Label Label1
- BackStyle = 0 'Transparent
- Caption = "FTP Server:"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 0
- Left = 120
- TabIndex = 8
- Top = 120
- Width = 1095
- End
- Begin Label Label1
- BackStyle = 0 'Transparent
- Caption = "User:"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 1
- Left = 120
- TabIndex = 7
- Top = 540
- Width = 855
- End
- Begin Label Label1
- BackStyle = 0 'Transparent
- Caption = "Password:"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 2
- Left = 2520
- TabIndex = 6
- Top = 540
- Width = 975
- End
- Sub Command1_Click ()
- FTP1.LocalFile = tLocalFile
- FTP1.Action = 5 'Upload File
- End Sub
- Sub Command2_Click ()
- FTP1.LocalFile = tLocalFile
- FTP1.Action = 4 'Download File
- End Sub
- Sub Command3_Click ()
- 'change directory
- tRemotePath = tRemotePath & "/" & tRemoteFile
- FTP1.RemotePath = tRemotePath
- tRemotePath = FTP1.RemotePath
- lFiles.Clear
- tRemoteFile = ""
- FTP1.Action = 8 'list
- End Sub
- Sub Command4_Click ()
- On Error GoTo ErrorHandling
- FTP1.WinsockLoaded = True
- lFiles.Clear
- If tFTPServer = "" Then
- MsgBox "Please supply a valid FTP server."
- Exit Sub
- End If
- FTP1.RemoteHost = tFTPServer
- FTP1.User = tUser
- FTP1.Password = tPassword
- FTP1.Action = 2 'Logon
- tRemotePath = FTP1.RemotePath
- FTP1.Action = 8 'list
- Exit Sub
- ErrorHandling:
- MsgBox Error$
- Exit Sub
- End Sub
- Sub Command5_Click ()
- FTP1.Action = 3 'Logoff
- End Sub
- Sub Form_Resize ()
- If WindowState <> 1 Then
- If ScaleWidth - tRemoteFile.Left > 31 Then
- tRemoteFile.Width = ScaleWidth - tRemoteFile.Left - 30
- End If
- If ScaleWidth - lFiles.Left > 31 Then
- lFiles.Width = ScaleWidth - lFiles.Left - 30
- End If
- If ScaleHeight - lFiles.Top > 31 Then
- lFiles.Height = ScaleHeight - lFiles.Top - 30
- End If
- lPITrail.Width = ScaleWidth - lPITrail.Left - 30
- End If
- End Sub
- Sub FTP1_DirList (DirEntry As String)
- lFiles.AddItem DirEntry
- End Sub
- Sub FTP1_PITrail (Direction As Integer, Message As String)
- Select Case Direction
- Case 0: lPITrail = "CLIENT: " & Message
- Case 1: lPITrail = "SERVER: " & Message
- Case 2: lPITrail = "INFO: " & Message
- End Select
- Debug.Print Direction & ": " & Message
- End Sub
- Sub FTP1_Transfer (BytesTransferred As Long, Text As String)
- lPITrail = "TRANSFER: " & BytesTransferred & " bytes"
- End Sub
- Sub lFiles_Click ()
- tRemoteFile = lFiles.List(lFiles.ListIndex)
- End Sub
- Sub optTransferMode_Click (Index As Integer)
- FTP1.TransferMode = Index
- End Sub
- Sub tRemotefile_Change ()
- FTP1.RemoteFile = tRemoteFile
- End Sub
-